from appium_practice.PO_MODE.page.basepage import CommonBasePage



ADDRESS_PAGE = "//android.widget.TextView[@text='添加成员']/ancestor::android.widget.LinearLayout[" \
               "3]/preceding-sibling::android.widget.TextView "
# 添加成员页
class AddMembersPage(CommonBasePage):

    def goto_address_page(self):
        from appium_practice.PO_MODE.page.addresspage import AddressPage
        # 返回主页
        self.find_app_element_and_click(('XPATH',ADDRESS_PAGE))
        return AddressPage(self.appium_driver)

    def goto_edit_members_page(self):
        self.find_app_element_and_click(('XPATH',"//android.widget.TextView[@text='手动输入添加']/../.."))
        from appium_practice.PO_MODE.page.editmemberspage import EditMembersPage
        return EditMembersPage(self.appium_driver)

